var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/businessComponent/imp/cpts/ConvertListHelp.tsx
var ConvertListHelp_exports = {};
__export(ConvertListHelp_exports, {
  ConvertListHelp: () => ConvertListHelp
});
module.exports = __toCommonJS(ConvertListHelp_exports);
var import_functionalComponent = require("../../../functionalComponent");
var import_util = require("../../../util");
var import_query_panel = require("../../query-panel");
var queryItems = [
  {
    xtype: "Input",
    label: "",
    name: "keyword",
    placeholder: "按关键字查询"
  }
];
var columns = [
  { dataIndex: "ruleNo", title: "编码" },
  { dataIndex: "ruleName", title: "名称" },
  { dataIndex: "targetBizName", title: "目的表单" }
];
function ConvertListHelp({ dataSource }) {
  const [ins] = (0, import_functionalComponent.useModal)();
  const [getRef] = (0, import_util.useRefs)();
  const onSearch = (_, { keyword }) => {
    getRef("table").current.getApi().filter(keyword);
  };
  ins.setApi({
    async getResult() {
      const ds = getRef("table").current.getApi().getSelectedData() || [];
      if (ds == null ? void 0 : ds.length) {
        return ds[0];
      } else {
        import_util.iup.alert("请先选择数据行！");
      }
      return null;
    }
  });
  return /* @__PURE__ */ React.createElement(import_util.Layout, { direction: "column", autoFit: true, style: { padding: 5 } }, /* @__PURE__ */ React.createElement(import_query_panel.QueryPanel, { items: queryItems, onSearch, style: { marginBottom: -11 } }), /* @__PURE__ */ React.createElement(import_util.Layout.Flex, { style: { border: import_util.cssVar.border, borderRadius: 4 } }, /* @__PURE__ */ React.createElement(import_functionalComponent.Table, { showRowNumber: true, columns, ref: getRef("table"), dataSource })));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ConvertListHelp
});
